<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://xmlns.jcp.org/jsf/core">
    <h:head>
        <title>I miei Ordini</title>
         <ui:include src="Header.xhtml"/>
    </h:head>
    <h:body>
        
          <div>
            <h:form>
                <p:dataTable id="table" var="ordine" value="#{ordineManagedBean.getOrdineUtente(login.utente)}" emptyMessage="Non sono presenti ordini per l'utente #{login.utente.username}">
                     <f:facet name="header">
                            <p:outputLabel value="Lista ordini"/>
                        </f:facet>
                   <p:column headerText="#ID">
                       <p:outputLabel value="#{ordine.id}"/>

                   </p:column>
                    
                     <p:column headerText="Data">
                         <p:outputLabel value="#{ordine.dataOrdine}"/>
                     </p:column>
                    
                   
                     <p:column headerText="Totale">
                         <h:outputFormat value="#{ordine.totale}">
                                <f:convertNumber minFractionDigits="2" maxFractionDigits="2"/>
                            </h:outputFormat> €
                        </p:column>
                    <p:column  headerText="Stato">
                        <p:outputLabel value="#{ordine.stato}"/>
                        </p:column>
                    
                  
                </p:dataTable>
                
            </h:form>
            
        </div>
        <ui:include src="Footer.xhtml"/>  
    </h:body>
</html>

